var body = document.body;
var header = document.querySelector('.header');

var myDate = new Date;
var year = myDate.getFullYear();//获取当前年
var month = myDate.getMonth() + 1;//获取当前月
var date = myDate.getDate();//获取当前日
var h = myDate.getHours();//获取当前小时数(0-23)
var m = myDate.getMinutes();//获取当前分钟数(0-59)
var s = myDate.getSeconds();//获取当前秒


if (h>19 || h < 6){
    body.style.backgroundImage = "url(../images/backgroundnigth.png)";
    body.style.backgroundColor = '#374e60';
    header.style.color = '#ffffff';
} else {
    body.style.backgroundImage = "url(../images/backgroundhot.png)";
    body.style.backgroundColor = '#f6f2f2';
    header.style.color = '#44291a';
}